{extend name="wmcommon/base" /}
{block name='top'}
<script>
    //手机网站的url 只需改这一处地方即可。
    var mobileAgent = new Array("iphone", "ipod", "ipad", "android", "mobile", "blackberry", "webos", "incognito", "webmate", "bada", "nokia", "lg", "ucweb", "skyfire");
    var browser = navigator.userAgent.toLowerCase();
    var isMobile = false;
    for (var i=0; i<mobileAgent.length; i++){
        if (browser.indexOf(mobileAgent[i])!=-1){
            isMobile = true;
            break;
        }
    }
    if(isMobile){
        //当前是手机或平板等小屏设备浏览，自动跳转到手机网站
        location.href = location.href.replace('www','m');
    }

    $('.nav .index').removeClass('on');
    var match_str = 'news|course|college|service|faq|about|policy|yanxuexinwen|special|photos|viewpoint|training|yanxueganwu';
    if (location.pathname.match(match_str)) {
        $('.nav .' + location.pathname.match(match_str)[0]).addClass('on');
    } else {
        $('.nav .index').addClass('on');
    }
</script>
<div id="header_content">
    <a class="logo" href="/">
        <img src="__STATIC__/wm_index/images/wm/logo.png" alt="">
    </a>
    <ul id="navbar">
        <li class="nav {if empty($pcate)}active{/if}">
            <a href="/">首页</a>
        </li>
        {foreach $category as $v}
        <li class="nav {if isset($pcate) && $v.id==$pcate.id}active{/if}">
            {php}$pid = $v['id']{/php}
            <a href='{:url("/item/$pid")}'>{$v.name ?: ''}</a>
            {notempty name='v.sub'}
            <ul>
                {foreach $v.sub as $vo}
                {php}$id = $vo['id']{/php}
                <li><a href='{:url("/item/$pid-$id")}'>{$vo.name ?: ''}</a></li>
                {/foreach}
            </ul>
            {/notempty}
        </li>
        {/foreach}

    </ul>
    <div class="right">
        <img src="__STATIC__/wm_index/images/wm/400.jpg">
        <!--<div class="search">
            <form action="/course/">
                <input type="text" name="k" placeholder="请输入关键词">
            </form>
            <p class="image"><img src="http://www.wmyanxue.com/statics/images/wm/icon_search.png" alt=""></p>
        </div>
        <div class="btns">
            <a class="btn" href="#">登录</a>
            <a class="btn" href="#">注册</a>//1546692901
        </div>-->
    </div>
</div>


{/block}


{block name='footer'}
<div class="content">
    <div class="left">
        <ul>
            <!--<li><a href="http://www.wmyanxue.com/about.html">关于未名</a></li>
            <li><a href="http://www.wmyanxue.com/products.html">课程体系</a></li>
            <li><a href="http://www.wmyanxue.com/products/college.html">培训认证</a></li>
            <li><a href="http://www.wmyanxue.com/products/service.html">研学规划</a></li>
            <li><a href="http://www.wmyanxue.com/hezuo.html">合作机构</a></li>
            <li><a href="http://www.wmyanxue.com/faq.html">FAQ</a></li>
            <li><a href="http://www.wmyanxue.com/yixiang.html">提交意向</a></li>
            <li><a href="http://www.wmyanxue.com/about/contact.html">联系我们</a></li>-->
            <li><a href="http://www.wmyanxue.com/hezuo.html">产品服务</a></li>
            <li><a href="http://www.wmyanxue.com/products/college.html">未名学院</a></li>
            <li><a href="http://www.wmyanxue.com/about/fwbz.html">服务保障</a></li>
            <li><a href="http://www.wmyanxue.com/about/contact.html">关于我们</a></li>
        </ul>
        <p class="">
            <a target="_blank" href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=11010802029646" style="display:inline-block;text-decoration:none;height:24px;line-height:24px; color:#777f8e;margin:12px 0px;"><img src="__STATIC__/wm_index/images/wm/beian.png" style="float:left;vertical-align:middle;"/>&nbsp;&nbsp;京公网安备 11010802029646号</a>
        </p>
        <p class="address">总部地址：北京市海淀区善缘街立方庭大厦</p>
    </div>
    <div class="right">
        <p class="qrcode image"><img src="__STATIC__/wm_index/images/wm/wechat.jpg" alt=""></p>
        <p class="txt">未名研学公众号二维码</p>
    </div>
</div>
{/block}

{block name='footerjs'}
<script src="__STATIC__/wm_index/js/wm/360.js"></script>
<script src="__STATIC__/wm_index/js/wm/idangerous.swiper.js"></script>
<script src="__STATIC__/wm_index/js/wm/isScroll.js"></script>
<script>
    $(function () {
        // 加载头部和底部
        //$("#header").load("header.html", function () {
        //    $("#header .index").addClass("on");
        //});
        //$("#footer").load("footer.html");
        // banner
        var banner = new Swiper('#banner', {
            autoplay: 5000, //可选选项，自动滑动
            loop: true, //可选选项，开启循环
            pagination: '.pagination',
            autoplayDisableOnInteraction: false,
        });
        // 跑马灯
        var silvertrack = new Swiper('#silvertrack', {
            autoplay: 1, //可选选项，自动滑动
            speed: 3000,
            loop: true, //可选选项，开启循环
            slidesPerView: "auto",
            loopedSlides: 3,
            autoplayDisableOnInteraction: false,
        });
        // 滚动动画
        $(".xScroll").xScroll();
        // 机构
        var institutions_list = new Swiper('#institutions_list', {
            slidesPerView: "auto",
        });
        // prev
        $("#institutions").on("click", ".btn_left", function () {
            institutions_list.swipePrev();
        });
        // next
        $("#institutions").on("click", ".btn_right", function () {
            institutions_list.swipeNext();
        });
        // 精品课程大搜索
        $("#search_course").on("click", ".tab .tab_item", function () {
            if (!$(this).hasClass("on")) {
                $(this).addClass("on").siblings(".tab_item").removeClass("on");
            }
        });
        $("#search_course").on("click", ".right .box span", function () {
            if (!$(this).hasClass("on")) {
                $(this).addClass("on").siblings("span").removeClass("on");
            }
        });
    })
</script>
{/block}